package com.lz.service.smsmail.common;

//import com.lz.common.RedisEnum;
import com.lz.common.util.GetCfg;

public class Config {
	
	/** zk配置节点路径 **/
	public static final String ZK_CONFIG_PATH = GetCfg.getString("Zk_Config_path", "/config/lzmh_microservice_smsmail_service");
	/** zk服务注册节点路径 **/
	public static final String ZK_SERVER_PATH = GetCfg.getString("Zk_Server_path", "/server/lzmh_microservice_smsmail_service/lzmh_microservice_smsmail_service");

	/** 流量限制开关 0：关1：开**/
	public static Integer FLOW_LIMIT_SWITCH; 
	/** 允许每秒流量数**/
	public static Integer FLOW_LIMIT_PERMITS_PERSECOND; 
	
	/**聚合APP Key**/
	public static String JUHE_APPKEY;
	/**聚合短信发送接口请求地址**/
	public static String JUHE_SMS_SEND_URL;
	/**聚合短信发送日志记录开关**/
	public static Integer JUHE_SMS_LOG_SWITCH;
	
	
	/**MailServerHost**/
	public static String MAILSERVER_HOST;
	/**发送邮件的服务器的端口**/
	public static String MAILSERVER_PORT;
	/**登陆邮件发送服务器的用户名**/
	public static String MAIL_USERNAME;
	/**登陆邮件发送服务器的密码错**/
	public static String MAIL_PASSWORD;
	/**邮件发送者的地址**/
	public static String MAIL_FROMADDRESS;
	
	/** 短信验证码缓存Key前缀 **/
	public static String SMS_AUTH_CODE_KEY;
	/** 短信验证码缓存时间（秒） **/
	public static Integer SMS_AUTH_CODE_TIME;
	
	
	/** 聚合验证码默认模板ID **/
	public static String JUHESMS_TPL_ID;
	/** 聚合验证码短信默认替换内容 **/
	public static String JUHESMS_TPL_VALUE;
	/**
	 * 配置初始化
	 */
	public static void init(){
		FLOW_LIMIT_SWITCH = GetCfg.getInt("Flow_Limit_Switch", 0);
		FLOW_LIMIT_PERMITS_PERSECOND = GetCfg.getInt("Flow_Limit_Permits_PerSecond", 10);
		
		
		JUHE_SMS_LOG_SWITCH = GetCfg.getInt("JuheSms_Log_Switch", 1);
		JUHE_APPKEY = GetCfg.getString("JuHeSms_AppKey", "128eb8da09002c14c65cbfe1d634ab8b");
		JUHE_SMS_SEND_URL = GetCfg.getString("JuHeSms_SendUrl", "http://v.juhe.cn/sms/send");
		
		
		MAILSERVER_HOST = GetCfg.getString("MailServerHost", "smtp.139.com");
		MAILSERVER_PORT = GetCfg.getString("MailServerPort", "25");
		MAIL_USERNAME = GetCfg.getString("UserName", "13616052510@139.com");
		MAIL_PASSWORD = GetCfg.getString("PassWord", "like110120");
		MAIL_FROMADDRESS = GetCfg.getString("FromAddress", "13616052510@139.com");
		
		SMS_AUTH_CODE_KEY = GetCfg.getString("Sms_Auth_Code_Key", "Sms_Auth_Code_");
		SMS_AUTH_CODE_TIME = GetCfg.getInt("Sms_Auth_Code_Time", 600);
		
		JUHESMS_TPL_ID = GetCfg.getString("Juhesms_Tpl_Id", "7201");
		JUHESMS_TPL_VALUE = GetCfg.getString("Juhesms_Tpl_Value", "#code#=111111");
		
		
	}
}

